﻿using System;

public partial class aspx_video_one : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (this.Request.QueryString["id"] == null)
            {
                Response.Redirect("~/");
            }
            try
            {
                int id = int.Parse(this.Request.QueryString["id"]);
                ds_名师讲堂.tb_视频DataTable dt;
                using (ds_名师讲堂TableAdapters.tb_视频TableAdapter da = new ds_名师讲堂TableAdapters.tb_视频TableAdapter())
                {
                    dt = da.GetDataBy视频ID(id);
                    da.Update点击量加1(id);
                }
                ds_名师讲堂.tb_视频Row dr = dt.Rows[0] as ds_名师讲堂.tb_视频Row;
                if (dr.Is详情Null() || string.IsNullOrWhiteSpace(dr.详情))
                {
                    using (ds_名师讲堂TableAdapters.v_名师讲堂视频TableAdapter da = new ds_名师讲堂TableAdapters.v_名师讲堂视频TableAdapter())
                    {
                        ltl详情.Text = (da.GetDataBy视频ID(id).Rows[0] as ds_名师讲堂.v_名师讲堂视频Row).全文内容;
                    }
                }
                else
                {
                    ltl详情.Text = dr.详情;
                }

                this.rpt_video.DataSource = dt;
                this.rpt_video.DataBind();
            }
            catch (Exception)
            {
                Response.Redirect("~/");
            }
        }
    }
}